package com.bd08.flink.demo.jing

object weiWordCount extends App{

  import org.apache.flink.api.scala._

      val benv = ExecutionEnvironment.getExecutionEnvironment
      val text = benv.readTextFile(
        "Who's there?",
        "I think I hear them. Stand, ho! Who's there?")
      text.flatMap { _.toLowerCase.split("\\W+") filter { _.nonEmpty } }
        .map { (_, 1) }
        .groupBy(0)
        .sum(1)

}
